<template>
<div>
    <div class="menuleft">
        <el-menu default-active="1" class="el-menu-vertical-demo" @open="handleOpen" @close="handleClose">
            <el-menu-item index="1">
                <router-link to="/home">
                    <i class="icon iconfont icon-ziyuan"></i>返回首页
                </router-link>
            </el-menu-item>
            <el-menu-item index="2" v-if="permissions.indexOf('报销单')>-1">
                <router-link to="/Expense">
                    <i class="icon iconfont icon-baoxiao"></i>&nbsp;报销单
                </router-link>
            </el-menu-item>
            <el-menu-item index="3" v-if="permissions.indexOf('借款单')>-1">
                <router-link to="/borrowMoney">
                    <i class="icon iconfont icon-jiekuan"></i>&nbsp;借款单
                </router-link>
            </el-menu-item>
            <el-menu-item index="4" v-if="permissions.indexOf('还款单')>-1">
                <router-link to="/refundMoney">
                    <i class="icon iconfont icon-huankuan"></i>&nbsp;还款单
                </router-link>
            </el-menu-item>
            <el-submenu index="5" v-if="permissions.indexOf('收入确认单')>-1">
                <template slot="title"><router-link to="/Income"><i class="icon iconfont icon-revenue">&nbsp;</i>收入确认单</router-link></template>
                <el-menu-item index="5-1" v-if="permissions.indexOf('应收明细')>-1">
                    <router-link to="/Detail">应收明细</router-link>
                </el-menu-item>
            </el-submenu>
        </el-menu>
    </div>
    <router-view></router-view>
</div>
</template>
<script>
import {
    mapState,
    mapGetters
} from 'vuex'
export default {
    name: 'Business',
    data() {
        return {
            activeIndex: "1",
            isshow: false,
            List: [{
                name: '应收明细',
                id: 'Detail'
            }],
        }
    },
    methods: {
        handleOpen(key, keyPath) {
            console.log(key, keyPath);
        },
        handleClose(key, keyPath) {
            console.log(key, keyPath);
        }
    },
    computed: {
        ...mapGetters({
            permissions: 'permissions'
        })
    },
}
</script>
<style scoped>
@import '../../common/css/index.css';
.menuleft {
    height: calc(100vh - 60px);
}

</style>